﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonHelper;

namespace WebsitSetup
{
    public partial class Finish : Form
    {
        public PublishIIS publishIIS
        { get; set; }

        public Finish()
        {
            InitializeComponent();
        }

        public Finish(PublishIIS publishIIS, VirtualDirectory virtualDirectory)
        {
            this.publishIIS = publishIIS;
            InitializeComponent();

            if (virtualDirectory != null)
            {
                lkUrl.Text = "http:\\\\" + CommonMethod.GetAddress() + IISManager.GetPort() + "\\" + virtualDirectory.Name;
            }            
        }

        private void btnFinish_Click(object sender, EventArgs e)
        {   
            Application.Exit();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("您确定要退出吗？", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Application.Exit();
            }
        }

        private void btnLast_Click(object sender, EventArgs e)
        {
            this.publishIIS.SetDeleteVirtualPath();
            this.publishIIS.Show();
            this.Hide();
        }

        private void lkUrl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("explorer.exe", this.lkUrl.Text.Trim());
        }
    }
}
